/*
 * commlib.c
 *
 *  Created on: Apr 12, 2015
 *      Author: mxw
 */
#include "commlib.h"

void *my_memset(void *s, int c, unsigned long n) {
}

void *my_memcpy(void *dest, const void *src, unsigned long n) {
    unsigned char* pdest = (unsigned char*)dest;
    unsigned char* psrc = (unsigned char*)src;

    if ((0 == dest) || (0 == src) || (0 == n)) return 0;
    while(0 != n) {
        *pdest = *psrc;
        pdest++;
        psrc++;
        n--;
    }
    return dest;
}

unsigned long my_strlen(const char *s) {
    unsigned long l = 0;

    if (0 == s) return 0;
    while(*s) {
        l++;
        s++;
    }
    return l;
}



